<template>
  <div>
    <commpVxeTable
      :key="reCommpVxeTable"
      :config="dataTableConfig"
      :columns="columnsVxe"
      :formItem="formItem"
      @checkboxChange="checkboxChange"
      ref="administrativeOffice"
      @searchEvent="searchEvent"
      @resetEvent="resetEvent"
      >
    </commpVxeTable>
  </div>
</template>
<script>
import assessCheckApi from './service/api.js'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import { deletes,deleteBatch, } from './service/index.js'
export default {
  components: {
    commpVxeTable
  },
  props:{
    linkName:{
      type:String,
      default:'',
      required:false,
    }
  },
  data() {
    return {
      reCommpVxeTable: '',
      dataTableConfig: {
        api: assessCheckApi.list,
        rowId: 'id',
        urlType: true,
        paramet:{}
      },
      formItem: [
        {
          label: '登记人',
          model: 'fdjr',
        },{
          label: '登记人部门',
          model: 'fdjrbm',
          type: 'datePicker'
        },{
          label: '金额',
          model: 'fje',
        },
      ],
      columnsVxe: [
        {
          type: 'checkbox',
          width: 60,
          fixed: 'left'
        },{
          title: '登记人',
          field: 'fdjr',
        },{
          title: '登记人部门',
          field: 'fdjrbm',
        },{
          title: '来源',
          field: 'fly',
        },{
          title: '说明',
          field: 'fsm',
        },{
          title: '金额',
          field: 'fje',
        },
      ],
      idList: [],
      passObj: {},
    }
  },
  methods: {
    // 勾选
    checkboxChange(val){
      //console.log('已选择',val)
      this.idList = []
      if(val.length){
        val.forEach(item => {
            this.idList.push(item.id)
        });
      }
    },
    // 搜索
    searchEvent(){
      this.dataTableConfig.paramet = {
          ...this.dataTableConfig.paramet,
      }
      //console.log(this.dataTableConfig.paramet)
    },
    // 重置
    resetEvent(){
      this.dataTableConfig.paramet = {
          ...this.dataTableConfig.paramet,
      }
    },
  },
}
</script>
<style lang="less">
.red-btn{
    color:  white !important;
    border: 1px solid #ed5565 !important;
    background-color: #ed5565 !important;
}
</style>
